<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich">
    <rich:toolBar id="navbar">
        <rich:toolBarGroup itemSeparator="Line">
            <a4j:commandLink value="Home" action="#{nav.updateCurrentPage}" immediate="true" >
                <f:param name="#{constant.common.REQ_CUR_PAGE}" value="#{pg.login}" />
                <f:param name="#{constant.common.REQ_USR_CUR_PAGE}" value="#{pg.home}" />
            </a4j:commandLink>
        </rich:toolBarGroup>
        <rich:dropDownMenu rendered="#{user.user != null}">
            <f:facet name="label"> 
                <h:outputText value="Profile"/>
            </f:facet>
            <rich:menuItem submitMode="ajax" value="View Profile" action="home" ajaxSingle="true" />
            <rich:menuItem submitMode="ajax" value="Edit Profile" action="user_edit" ajaxSingle="true" />
        </rich:dropDownMenu>
        <rich:toolBarGroup itemSeparator="Line">
            <a4j:commandLink value="Browse" action="#{nav.updateCurrentPage}" immediate="true" >
                <f:param name="#{constant.common.REQ_CUR_PAGE}" value="/public/users.xhtml" />
            </a4j:commandLink>
        </rich:toolBarGroup>
        <rich:toolBarGroup location="right" itemSeparator="Line">
            <h:outputText value="Welcome, #{user.username}"/>
            <a4j:commandLink rendered="#{user.user == null}" action="#{nav.updateCurrentPage}" value="#{msgs.login}" immediate="true" >
                <f:param name="#{constant.common.REQ_CUR_PAGE}" value="/public/login.xhtml" />
            </a4j:commandLink>
            <a4j:commandLink rendered="#{user.user == null}" action="#{nav.updateCurrentPage}" value="#{msgs.register}" immediate="true" >
                <f:param name="#{constant.common.REQ_CUR_PAGE}" value="/public/signup.xhtml" />
            </a4j:commandLink>
            <a4j:commandLink rendered="#{user.user != null}" action="#{login.logout}" value="#{msgs.logout}" immediate="true"/>
        </rich:toolBarGroup>
    </rich:toolBar>
</ui:composition>

